home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / WWIV Mods / COMMON20.ZIP / COMMON.MOD < prev    next >
Encoding:
Text File  |  1994-04-24  |  10.9 KB  |  298 lines

  1. ┌─────────────────────────────────────────────────────────────────────────────┐
  2. │ ModTitle: Asylum Common v2.0a for 4.23                       April 24, 1994 │
  3. │ Mods that use this mod will be refered to as a 'Common Mod'                 │
  4. │                                                                             │
  5. │ Difficulty: Typical Asylum Mod                                              │
  6. │                                                                             │
  7. │ Files affected: MAKEFILE, COMMON.C VARDEC.H                                 │
  8. │                                                                             │
  9. │ Common functions that quite a few Asylum mods (will) rely on.               │
  10. │                                                                             │
  11. │ Current mods requiring this mod: Pulldown Menus, Listfile Plus Q/Nscan      │
  12. │                                  Config Plus and the all new QWK mod        │
  13. │                                                                             │
  14. │ BY: Asylum Group                                                            │
  15. │ Credits: No one                                                             │
  16. └─────────────────────────────────────────────────────────────────────────────┘
  17.  
  18.  
  19. Fixes all around, sorry, I guess I am not perfect, everytime I try to use a
  20. function in a different way, I find new bugs....
  21.  
  22.  
  23. + Add
  24. - Subtract
  25. * Change
  26. = Existing
  27. @# See number
  28.  
  29.     
  30.   I will not be responsible for any problems that arise because of this or any
  31.   other of my mods.  If you have something to loose, make a way to recover it.
  32.   If you don't know how to do this properly, then don't install this.
  33.   If you can't install this mod without any problems, then don't try.
  34.   
  35.   Now,... this mod works as far as I have tested, as has many other people.
  36.   
  37.  
  38. ***Note  (Pertains to people upgrading from an older version of common)
  39.   I removed the register_common mod stuff, the stuff that goes at the begining
  40.   of bbs.c in main(), you will need to remove all that code that pertains to
  41.   it once this is installed to get it to compile.  Reason is, it never
  42.   developed into anything useful, and just took away precious memory, I modified
  43.   it slightly so that when you 'show_common_mods', it will just print a file,
  44.   forget which, but that way, you can just add the mods you put in, into some
  45.   .MSG or ANS and it will be printed out.
  46.  
  47.  
  48. ***** If you are upgrading from version 1.anything or do the following to
  49. ***** upgrade
  50.  
  51. Step 4A
  52.      4B
  53.      4E
  54.  
  55.      Copy COMMON.C AND COMMON2.C, COMMON.H into your dir
  56.  
  57.      Rebuild your FCNS.H file (MAKE FCNS or get declarations from step 5)
  58.  
  59.      Done!
  60.  
  61. ***** End of upgrade
  62.  
  63.  
  64.  
  65. Step A)
  66.   Place the included files in your wwiv directory, should include COMMON.C,
  67.   COMMON2.C and COMMON.H.
  68.   
  69.  
  70. Step 1) VARDEC.H
  71.   Going to make a way to turn off certain Asylum mods, and don't want to change
  72.   your userrec for every mod.
  73.  
  74.   This will take only 8 bits from your user rec.
  75.  
  76.   NOTE: If you already modified your userrec at this same spot, put this before
  77.   your previous mod so that all memory will point to the correct spot.  And that
  78.   goes for future mods at this spot, if you add anothe variable, add it before
  79.   the declarations.
  80.  
  81. =     char
  82. =       res_float[32];  /* reserved for real values */
  83. =
  84. =     char
  85. /*********  Be sure to decrement this by 1, ie 100 to 99
  86. *       res_gp[99];    /* reserved for whatever */
  87. =
  88.  
  89. +     unsigned char use_internal_tag : 1;
  90. +     unsigned char use_menusys : 1;
  91. +
  92. +     unsigned char use_three : 1;
  93. +     unsigned char use_four : 1;
  94. +     unsigned char use_five : 1;
  95. +     unsigned char use_six : 1;
  96. +     unsigned char use_seven : 1;
  97. +     unsigned char use_eight : 1;
  98.  
  99. } userrec;
  100.  
  101.  
  102.   
  103.   
  104. Step 2) VARS.H
  105.   Have vars.h include common.h into your bbs as well as a simple define
  106.   
  107. = #include <dos.h>
  108. = #include <alloc.h>
  109. = #include <time.h>
  110.                        /***********  Read !!!!!!!!! ***********/
  111. + #include "common.h"  /*********** important, make sure this is before fcns.h ***********/
  112. = #include "fcns.h"    /*********** Did you read ^^^^^??????????? *********/
  113.  
  114.  
  115.  
  116.  
  117. Step 3) BBS.C
  118.   Put in a check to give us an error if we mess up on the userrec
  119.  
  120. = void main(int argc, char *argv[])
  121. = {
  122. =   char s[81],ch,frc[81], rf[30],*ss;
  123. =   int i,i1,num_min=0;
  124. =   unsigned int ui=0, us=0;
  125. =   double dt;
  126. =   unsigned short c_s,c_o;
  127. =   int this_usernum=0;
  128. =
  129. + #if sizeof(userrec) != 1024
  130. + #error Userrec is not 1024
  131. + #endif
  132.  
  133.  
  134. Step 4)
  135.   MAKEFILE.  This is only for the borland make, if you don't use it, then you
  136.   will have to modify your makefile yourself, being that I don't use it, and
  137.   do not know the syntax.
  138.   
  139.   A) Search for BBS_NRM and add our non-overlaid part of common
  140.  
  141. = BBS_NRM = \
  142. =        msgbase.obj  msgbase1.obj share.obj    strings.obj  \
  143. *        utility.obj  xfer.obj     common2.obj
  144.                                   ^^^^^^^^^^^ add this
  145.  
  146.   B) Down a little add our other part
  147.  
  148. = BBS_O_NRM = \
  149. =        $(OBJ)\msgbase1.obj $(OBJ)\share.obj    $(OBJ)\strings.obj  \
  150. *        $(OBJ)\utility.obj  $(OBJ)\xfer.obj     $(OBJ)\common2.obj
  151.                                                  ^^^^^^^^^^^^^^^^^^ add this
  152.  
  153.  
  154.   C) Search for BBS_OVL and add the common.obj to the end of it, to add
  155.      our overlaid part
  156.   
  157. =       sysopf.obj   tedit.obj    uedit.obj    voteedit.obj \
  158. *       xferovl.obj  xfertmp.obj  xinit.obj    common.obj
  159.                                                ^^^^^^^^^^ added part
  160.   D) Go down a little to BBS_O_OVL
  161.   
  162. =        $(OBJ)\voteedit.obj $(OBJ)\xferovl.obj  $(OBJ)\xfertmp.obj  \
  163. *        $(OBJ)\xinit.obj $(OBJ)\common.obj
  164.                           ^^^^^^^^^^^^^^^^^ added part
  165.  
  166.   E) Down a little to the NON-OVERLAID PART
  167.  
  168. = share.obj   : share.c
  169. =   $(TCC_NRM)
  170. = utility.obj : utility.c
  171. =   $(TCC_NRM)
  172. = xfer.obj    : xfer.c
  173. =   $(TCC_NRM)
  174. + common2.obj : common2.c
  175. +   $(TCC_NRM)
  176.  
  177.  
  178.  
  179.   F) And now... down a ways... (IN THE OVERLAID PART)
  180.  
  181. xfertmp.obj : xfertmp.c
  182.   $(TCC_OVL)
  183. xinit.obj   : xinit.c
  184.   $(TCC_OVL)
  185. + common.obj : common.c
  186. +  $(TCC_OVL)
  187.  
  188.  
  189. Step 5)
  190.     FCNS.H
  191.     
  192.     Either update your fcns.h by typing make fcns or by manually inserting
  193.     the following defenitions:
  194.     
  195.     These must go in between the #ifndef _FCNS_H_ and the final #endif
  196.  
  197. /* File: common2.c */
  198.  
  199. int find_batch_queue(char *fn);
  200. void remove_batch(char *fn);
  201. void CLS(void);
  202. void CEOL_XY( unsigned x, unsigned y );
  203. void CURSORUP( int x );
  204. void CURSORDOWN( int x );
  205. void CURSORRIGHT(int x);
  206. void CURSORLEFT(int x);
  207. void CHAR_XY( int x, int y, int z );
  208. void XCTRPRINTF(int y, char *str );
  209. void PRINTF_XY( int x, int y, char *str );
  210. void BEEP(void);
  211. void EOL(void);
  212. void SAVCURS(void);
  213. void RECALLCURS(void);
  214. char *pad_string(char *string, int length);
  215. char *pad_string_bg(char *string, int length, int bg);
  216. char *justify_string(char *string, int length, int bg, int type);
  217. int pd_amount_in_list(char *list, int rows, int cols);
  218. int largest_in_list(char *list, int rows, int cols);
  219. int widest_in_list(char *list[], int amount);
  220. int wwiv_strlen(char *s);
  221. int count_list(char *list[]);
  222. int search_list(char **list, char *search, int amount_in_list);
  223. int search_list_i(char **list, char *search, int amount_in_list);
  224. void outstr_color(char *s);
  225. void outchr_color(char c);
  226. void npr_color(char *fmt, ...);
  227. char * strip_string(char *string);
  228. char *unalign(char *filename);
  229. void buildfor(unsigned char attr, char *s);
  230. void buildback(unsigned char attr, char *s);
  231. void repeat_char(unsigned char x, int amount);
  232. char *strstr_nocase(char *s1, char *s2);
  233. void statusbar(statusbarrec *sb);
  234.  
  235.  
  236. /* File: common.c */
  237.  
  238. unsigned char pd_getkey(void);
  239. char pd_inkey(void);
  240. unsigned side_menu(int *menu_pos, int redraw, char *menu_items[], int xpos, int ypos, struct side_menu_colors *smc);
  241. int new_control_break(void);
  242. unsigned get_kb_event(void);
  243. char onekdefault(char *s, char defaultchar);
  244. char onek_ncr(char *s);
  245. int do_sysop_command(unsigned command);
  246. void colorize_text(char *buffer);
  247. void sprintf_color(char *buffer, char *fmt, ...);
  248. void show_common_mods(void);
  249. int copyfile(char *src, char *dst, int stats);
  250. int movefile(char *src, char *dst, int stats);
  251. char **alloc_2d(int row, int col, unsigned size);
  252. void free_2d(char **pa);
  253. varimenurec * addvarimenu(varimenurec *current, varimenurec *newitem);
  254. void varimenuforward(varimenurec *menu, varimenuinfo *info);
  255. void varimenubackward(varimenurec *menu, varimenuinfo *info);
  256. void varimenuleft(varimenurec *menu, varimenuinfo *info);
  257. void varimenuup(varimenurec *menu, varimenuinfo *info);
  258. void varimenuright(varimenurec *menu, varimenuinfo *info);
  259. void varimenudown(varimenurec *menu, varimenuinfo *info);
  260. void varimenu(varimenurec *menu, varimenuinfo *info);
  261. varimenurec * getvarimenurec(varimenurec *menu, int which);
  262. void redrawvarimenu(int redraw, varimenurec *menu, varimenuinfo *info);
  263. void killvarimenu(varimenurec *menu);
  264. void kill_inputrec(inputeditrec *input);
  265. void kill_showtextrec(showtextrec *text);
  266. void kill_radiobutton(radiobuttonrec *radio);
  267. void kill_checkbox(checkboxrec *check);
  268. int varimenu_findhotkey(varimenurec *menu, varimenuinfo *info);
  269. void fillvarimenurec(varimenurec *menu, void *rec, int type, unsigned hotkey, int returnvalue, int active);
  270. void build_inputrec(inputeditrec *input, int maxlen, int xpos, int ypos, int width, int insert, int char_case);
  271. void build_radiobuttonrec(radiobuttonrec *radio, int xpos, int ypos, int amount, int pos, int rc, int fc);
  272. void build_checkboxrec(checkboxrec *check, int xpos, int ypos, int amount, int pos, unsigned bi, int rc, int fc);
  273. void radio_button(radiobuttonrec *radio, varimenuinfo *info);
  274. void check_box(checkboxrec *check, varimenuinfo *info);
  275. void input_edit(inputeditrec *input, varimenuinfo *info);
  276. int ok_char_inputedit(inputeditrec *input, varimenuinfo *info);
  277. void add_char_inputedit(inputeditrec *input, varimenuinfo *info);
  278. void redrawinputedit(int type, inputeditrec *input, varimenuinfo *info, int mode);
  279. void delete_inputedit(inputeditrec *input, varimenuinfo *info);
  280. void redrawradiobutton(int redraw, radiobuttonrec *radio, varimenuinfo *info, int mode);
  281. void redrawcheckbox(int redraw, checkboxrec *check, varimenuinfo *info, int mode);
  282. void redrawshowtext(int redraw, showtextrec *text, varimenuinfo *info, int mode);
  283. void showtext(showtextrec *text, varimenuinfo *info);
  284. void build_showtextrec(showtextrec *text, int xpos, int ypos, int width, char *t, int justify, int bg);
  285. void test_vm(void);
  286. void wait_sec_or_hit(double seconds);
  287. void wait_sec(double seconds);
  288. long filesize(FILE *stream);
  289. int fset_rec(FILE *stream, unsigned rec, unsigned rec_size);
  290. int set_rec(int filenum, unsigned rec, unsigned rec_size);
  291. int check_bitfield(unsigned bitfield, char *which);
  292. void test_check_bitfield(void);
  293. int check_arc(char *filename);
  294. int match_archiver(char *filename);
  295. void strip_heart_colors(char *text);
  296. long file_daten(char *filename);
  297.  
  298.